package org.main.bean.POJO;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.main.bean.entity.User;

import javax.persistence.*;

/**
 * By： 土豆菌
 * 2019-03-01 0:10
 */
@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(name = "gwc")
@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})
public class Pgwc implements java.io.Serializable  {

    @Id
    @Column(name = "userId")
    private int userId;
    @Column(name = "goodsId")
    private int goodsId;
    @Column(name = "goodsShu")
    private String goodsShu;
    @Column(name = "goodsDj")
    private String goodsDj;

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinColumn(name = "goodsId",insertable = false, updatable = false)
    private OGoods oGoods;

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinColumn(name = "userId",insertable = false, updatable = false)
    private User user ;
}
